Part Number Hot Search : 
ZVNL120A SP8604 ET1109 MSAU212 BUL312FH AD855 CH5048 SA2002P
Product Description
Full Text Search
 

To Download W742C814 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 W742C814 4-BIT MICROCONTROLLER
Table of Contents1. 2. 3. 4. 5. 6. GENERAL DESCRIPTION .............................................................................................................3 FEATURES .....................................................................................................................................3 PIN CONFIGURATION ...................................................................................................................4 PIN DESCRIPTION.........................................................................................................................5 BLOCK DIAGRAM ..........................................................................................................................6 FUNCTIONAL DESCRIPTION .......................................................................................................7 6.1 6.2 6.3 6.4 Program Counter (PC)......................................................................................................7 Stack Register (STACK) ...................................................................................................7 Program Memory (ROM) ..................................................................................................7
6.3.1 6.4.1 6.4.2 6.4.3 6.4.4 ROM Page Register (ROMPR) .................................................................................. 8 Architecture ................................................................................................................ 9 Page Register (PAGE) ............................................................................................... 9 WR Page Register (WRP)........................................................................................ 10 Data Bank Register (DBKR)..................................................................................... 10
Data Memory (RAM).........................................................................................................9
6.5 6.6 6.7 6.8 6.9 6.10 6.11
Accumulator (ACC).........................................................................................................11 Arithmetic and Logic Unit (ALU) .....................................................................................11 Oscillator .........................................................................................................................11 Dividers ...........................................................................................................................12 Dual-clock Operation ......................................................................................................12 WatchDog Timer (WDT) and WatchDog Timer Register (WDTR) .................................13 Timer/Counter .................................................................................................................15
6.11.1 6.11.2 6.11.3 6.11.4 Timer 0 (TM0) ........................................................................................................ 15 Timer 1 (TM1) ........................................................................................................ 16 Mode Register 0 (MR0).......................................................................................... 18 Mode Register 1 (MR1) & MFP Control Pin (BUZCR) ........................................... 18
6.12 6.13 6.14
Interrupts.........................................................................................................................19 Stop Mode Operation......................................................................................................20
6.13.1 6.14.1 6.14.2 Stop Mode Wake-up Enable Flag for RC Port (SEF) ............................................. 20 Hold Mode Release Enable Flag (HEF) ................................................................. 22 Interrupt Enable Flag (IEF)..................................................................................... 22
Hold Mode Operation......................................................................................................21
-1-
Publication Release Date: February 12, 2003 Revision A2
W742C814
6.14.3 6.14.4 6.14.5
Port Enable Flag (PEF) .......................................................................................... 22 Hold Mode Release Condition Flag (HCF)............................................................. 23 Event Flag (EVF).................................................................................................... 23
6.15 6.16
Reset Function................................................................................................................24 Input/Output Ports RA, RB & RD ....................................................................................25
6.16.1 6.16.2 6.16.3 6.16.4 Port Mode 0 Register (PM0) .................................................................................. 26 Port Mode 1 Register (PM1) .................................................................................. 27 Port Mode 2 Register (PM2) .................................................................................. 27 Port Mode 5 Register (PM5) .................................................................................. 27 Port Status Register 0 (PSR0) ............................................................................... 29
6.17 6.18 6.19
Input Ports RC ................................................................................................................28
6.17.1
Output Port RE................................................................................................................29 DTMF Output Pin (DTMF) ..............................................................................................29
6.19.1 6.19.2 DTMF Register....................................................................................................... 30 Dual Tone Control Register (DTCR) ...................................................................... 30
6.20 6.21
MFP Output Pin (MFP) ...................................................................................................30 LCD Controller/Driver .....................................................................................................31
6.21.1 6.21.2 LCD RAM addressing method ............................................................................... 33 The output waveforms for the LCD driving mode................................................... 33
7. 8. 9. 10. 11.
ABSOLUTE MAXIMUM RATINGS................................................................................................35 DC CHARACTERISTICS ..............................................................................................................36 AC CHARACTERISTICS ..............................................................................................................37 INSTRUCTION SET TABLE .........................................................................................................38 REVISION HISTORY ....................................................................................................................46
-2-
W742C814
1. GENERAL DESCRIPTION
The W742C814 is a high-performance 4-bit micro-controller (C) that provides an LCD driver. The device contains a 4-bit ALU, two 8-bit timers, two dividers (for two oscillators) in dual-clock operation, a 32 x 4 LCD driver, five 4-bit I/O ports (including 1 output port for LED driving), and one channel DTMF generator. There are also five interrupt sources and 8-levels subroutine nesting for call subroutine or interrupt applications. The W742C814 operates on very low current and has two power reduction modes, that is the dual-clock slow operation and STOP mode, which help to minimize power dissipation.
2. FEATURES
* *
Operating voltage: 2.4V - 5.5V Dual-clock operation mode (Connect to 32768 Hz crystal only) Fslow oscillator: 32768 Hz OSC Ffast oscillator: PLL (Phase Lock Loop) output enable
*
Memory - 4096 x 16 bits program ROM (including 16K x 4 bit look-up table) - 1024 x 4 bits data RAM (including 16 nibbles x 16 pages working registers) - 32 x 4 LCD data RAM
*
20 input/output pins - Port for input only: 1 ports/4 pins (RC) - Input/output ports: 3 ports/12 pins (RA, RB & RD) - High sink current output port for LED driving: 1 port /4 pins (RE)
*
Power-down mode - Hold function: no operation (excluding Fslow and Fosc oscillator) - Stop function: no operation (Fslow and Fosc oscillator are stopped) - Dual-clock slow operation mode: system is operated by 32768 Hz (FOSC = Fslow and Ffast stopped)
*
Five types of interrupts - Four internal interrupts (Divider0, Divider1, Timer 0, Timer 1) - One external interrupts (RC Port)
*
LCD driver output - 32 segments x 4 commons - 1/4 duty 1/3 bias driving mode
*
MFP output pin - Output is software selectable as modulating or non-modulating frequency - Works as frequency output specified by Timer 1 DTMF output pin (PLL should be enable in this function)
*
-3-
Publication Release Date: February 12, 2003 Revision A2
W742C814
- Output is one channel Dual Tone Multi-Frequency signal for dialing
*
Two built-in 14-bit frequency dividers - Divider0: the clock source is the output of the Fosc-oscillator - Divider1: the clock source is the output of the Fslow-oscillator
*
Two built-in 8-bit programmable countdown timers - Timer 0: one of two internal clock frequencies (FOSC/4 or FOSC/1024) can be selected - Timer 1: with auto-reload function and one of three internal clock frequencies (FOSC, FOSC/64 or Fs) can be selected by MR1 register; and the specified frequency can be delivered to MFP pin
* * * *
Built-in 18/15-bit watchdog timer selectable for system reset; enable the watch dog timer or not is determined by code option Build-in Power-on reset detested circuit Powerful instruction set: 1XX instructions 8-levels subroutine (include interrupt) nesting
3. PIN CONFIGURATION
For W742C814 QFP 80-pin
T E S T 2 T E V SVNXVX TDCXF I 1D F N S C E ONG MC3 3 1
/ R R MR AAFE 10PS
D T M F
X ONDD UCHH T 12
V D D 1
V D D 2
C O M 0
C O M 1
C O M 2
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41
RA2 RA3 RB0 RB1 RB2 RB3 RC0 RC1 RC2 RC3 RD0 RD1 RD2 RD3 RE0 RE1
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25
SEG30 SEG29 SEG28 SEG27 SEG26 SEG25 SEG24 SEG23 SEG22 SEG21 SEG20 SEG19 SEG18 SEG17 SEG16 SEG15
NNRRVNN CCEES CC 23S
S E G 0
S E G 1
S E G 2
S E G 3
S E G 4
S E G 5
S E G 6
S E G 7
S E G 8
S E G 9
S E G 1 0
S E G 1 1
S E G 1 2
S E G 1 3
SNN ECC G 1 4
-4-
W742C814
4. PIN DESCRIPTION
SYMBOL I/O FUNCTION
XIN XOUT VF VXXF RA0 - RA3 RB0 - RB3 RC0 - RC3 RD0 - RD3 RE0 - RE3 MFP DTMF
RES
I O I I I/O I/O I I/O O O O I O O I I I I I
Input pin for 32.768 Hz oscillator. Connected to 32.768 KHz crystal only. Output pin for 32.768 Hz oscillator. Connected to 32.768 KHz crystal only. Low pass filter for PLL circuit. Connected capacitor to VSS. Regulator for PLL circuit. Connected capacitor (10 F) to VSS. Input/Output port. Input/output mode specified by port mode 1 register (PM1). Input/Output port. Input/output mode specified by port mode 2 register (PM2). 4-bit port for input only. Each pin has an independent interrupt capability. Input/Output port. Input/output mode specified by port mode 5 register (PM5). Output port only. With high sink current capacity for the LED application. Output pin only. This pin can output modulating or nonmodulating frequency, or Timer 1 specified frequency. It can be selected by bit 0 of BUZCR (BUZCR.0). This pin can output dual-tone multifrequency signal for dialling. System reset pin. LCD segment output pins. LCD common signal output pins. The LCD alternating frequency can be selected by code option. Connection terminals for voltage doubler (halver) capacitor. Positive (+) supply voltage terminal. Refer to Functional Description. For IC testing used, User don't care these pin. Positive power supply (+). NEGATIVE POWER SUPPLY (-).
SEG0 - SEG31 COM0 - COM3 DH1, DH2 VDD1 VDD2 TEST1, TEST2 VDD VSS
-5-
Publication Release Date: February 12, 2003 Revision A2
W742C814
5. BLOCK DIAGRAM
SEG0~SEG31
COM0~COM3
VDD1-2
DH1-2
RAM (1024*4)
LCD
DRIVER PORT RA RA0-3
ROM (4096*16)
(look_up table 16K*4)
+1(+2)
ACC ALU
PORT RB
RB0-3
PORT RC
RC0-3
PC
Central Control Unit
IEF HCF HEF EVF SCR MR0 DTMF PEF SEF PR MR1 DTCR
PORT RD
RD0-3
PORT RE
RE0-3
STACK (8 Levels)
PSR0 PM0 PM1
.
.
.
DTMF Generator
DTMF
SEL
Timer 0 (8 Bit)
Timer 1 (8 Bit)
Modulation Frequency Pulse
MUX Divider 1 (12/14 Bit)
MFP
Watch Dog Timer (4 Bit)
Divider 0 (14 Bit)
VDD VSS Timing Generator PLL RES
XOUT
XIN
-6-
W742C814
6. FUNCTIONAL DESCRIPTION
6.1 Program Counter (PC)
Organized as an 14-bit binary counter (PC0 to PC13), the program counter generates the addresses of the 4096 x 16 on-chip ROM containing the program instruction words. Before the jump or subroutine call instructions are to be executed, the destination ROM page must be determined firstly. The confirmation of the ROM page can be done by executing the MOV ROMPR, #I or MOV ROMPR, R instruction. When the interrupt or initial reset conditions are to be executed, the corresponding address will be loaded into the program counter directly. The format used is shown below. Table 1. Vector address and interrupt priority
ITEM ADDRESS INTERRUPT PRIORITY
Initial Reset INT 0 (Divider0) INT 1 (Timer 0) INT 2 (Port RC) INT 3 (Divider1) INT 4 (Timer 1) JP Instruction Subroutine Call
0000H 0004H 0008H 000CH 0014H 0020H XXXXH XXXXH
1st 2nd 3rd 4th 5th -
6.2 Stack Register (STACK)
The stack register is organized as 42 bits x 8 levels (first-in, last-out). When either a call subroutine or an interrupt is executed, the program counter will be pushed onto the stack register automatically. At the end of a call subroutine or an interrupt service subroutine, the RTN instruction must be executed to pop the contents of the stack register into the program counter. (Refer to Table 8) When the stack register is pushed over the eight levels, the contents of the first level will be lost. In other words, the stack register is always sixteen levels deep.
6.3 Program Memory (ROM)
The read-only memory (ROM) is used to store program codes; and the look-up table is arranged as 16384 x 4 bits. The program ROM is divided into two pages; the size of each page is 2048 x 16 bits. So the total ROM size is 4096 x 16 bits. Before the jump or subroutine call instructions are to be executed, the destination ROM page must be determined firstly. The ROM page can be selected by executing the MOV ROMPR, #I or MOV ROMPR, R instruction. But the branch decision instructions (e.g. JB0, SKB0, JZ, JC, ...) must jump to the same ROM page which the branch decision instructions are in. The whole ROM can store both instruction codes and the look-up table. Each look-up table element is composed of 4 bits, so the look-up table can be addressed up to 16384 elements. Instruction MOVC R is used to read the look-up table content and transfer table data to the RAM. But before reading the addressed look-up table content, the content of the look-up table pointer (TAB) must be determined firstly. The address of the look-up table element is allocated by the content of Publication Release Date: February 12, 2003 Revision A2
-7-
W742C814
TAB. The MOV TAB0 (TAB1, TAB2, TAB3), R instructions are used to allocate the address of the wanted look-up table element. The TAB0 register stores the LSB 4 bits of the look-up table address. The organization of the program memory is shown in Figure 6-1.
16 bits 0000H : 03FFH 1st page 0400H : 07FFH 0800H : 2nd page 0BFFH 0C00H : 0FFFH
Look-up table address: 0000H : 0FFFH
Each element (4 bits) of the look-up table
Look-up table address: 1000H : 1FFFH
: :
Look-up table address: 2000H : 2FFFH Look-up table address: 3000H : 3FFFH
4096 X 16 BITS
Figure 6-1 Program Memory Organization
6.3.1 ROM Page Register (ROMPR)
The ROM page register is organized as a 4-bit binary register. The bit descriptions are as follows:
3 ROMPR
Note: R/W means read/write available.
2
1
0 R/W
Bit 3, Bit 2, Bit 1 is reserved. Bit 0 ROM page preselect bits: 0 = ROM page 0 (0000H - 07FFH) 1 = ROM page 1 (0800H - 0FFFH)
-8-
W742C814
6.4 Data Memory (RAM)
6.4.1 Architecture
The static data memory (RAM) used to store data is arranged as 1024 x 4 bits. The data RAM is divided into eight banks; each bank has 128 x 4 bits. Executing the MOV DBKR, WR or MOV DBKR, #I instruction can determine which data bank is used. The data memory can be addressed directly or indirectly. But the data bank must be confirmed firstly; and the page in the data bank will be done in the indirect addressing mode, too. In indirect addressing mode, each data bank will be divided into eight pages. Before the data memory is addressed indirectly, the page which the data memory is in must be confirmed. The organization of the data memory is shown in Figure 6-2.
4 bits 000H : 07FH 080H : 0FFH 1st data bank
(or Working Registers bank) 1st data RAM page (or 1st WR page) 2nd data RAM page (or 2nd WR page) 3rd data RAM page (or 3rd WR page) : : 8th data RAM page (or 8th WR page) 70H : 7FH 00H : 0FH 10H : 1FH 20H : 2FH
2nd data bank
(or Working Registers bank)
1024 addresses
3rd data bank : : 8th data bank 1024 * 4 bits
380H : 3FFH
Figure 6-2
Data Memory Organization
The 1st and 2nd data bank (00H to 7FH & 80H to FFH) in the data memory can also be used as the working registers (WR). It is also divided into sixteen pages. Each page contains 16 working registers. When one page is used as WR, the others can be used as the normal data memory. The WR page can be switched by executing the MOV WRP, R or MOV WRP, #I instruction. The data memory cannot operate directly with immediate data, but the WR can do. The relationship between data memory locations and the page register (PAGE) in indirect addressing mode is described in the next sub-section.
6.4.2 Page Register (PAGE)
The page register is organized as a 4-bit binary register. The bit descriptions are as follows:
3 PAGE
Note: R/W means read/write available.
2 R/W
1 R/W
0 R/W
-9-
Publication Release Date: February 12, 2003 Revision A2
W742C814
Bit 3 is reserved. Bit 2, Bit 1, Bit 0 Indirect addressing mode pre-select bits: 000 = Page 0 (00H - 0FH) 001 = Page 1 (10H - 1FH) 010 = Page 2 (20H - 2FH) 011 = Page 3 (30H - 3FH) 100 = Page 4 (40H - 4FH) 101 = Page 5 (50H - 5FH) 110 = Page 6 (60H - 6FH) 111 = Page 7 (70H - 7FH)
6.4.3 WR Page Register (WRP)
The WR page register is organized as a 4-bit binary register. The bit descriptions are as follows:
3 WRP
Note: R/W means read/write available.
2 R/W
1 R/W
0 R/W
R/W
Bit 3, Bit 2, Bit 1, Bit 0 Working registers page preselect bits: 0000 = WR Page 0 (00H - 0FH) 0001 = WR Page 1 (10H - 1FH) 0010 = WR Page 2 (20H - 2FH) 0011 = WR Page 3 (30H - 3FH) 0100 = WR Page 4 (40H - 4FH) 0101 = WR Page 5 (50H - 5FH) 0110 = WR Page 6 (60H - 6FH) 0111 = WR Page 7 (70H - 7FH) 1000 = WR Page 8 (80H - 8FH) 1001 = WR Page 9 (90H - 9FH) 1010 = WR Page A (A0H - AFH) 1011 = WR Page B (B0H - BFH) 1100 = WR Page C (C0H - CFH) 1101 = WR Page D (D0H - DFH) 1110 = WR Page E (E0H - EFH) 1111 = WR Page F (F0H - FFH)
6.4.4 Data Bank Register (DBKR)
The data bank register is organized as a 4-bit binary register. The bit descriptions are as follows:
3 DBKR
Note: R/W means read/write available.
2 R/W
1 R/W
0 R/W
- 10 -
W742C814
Bit 3 is reserved Bit 2, Bit 1, Bit 0 Data memory bank preselect bits: 000 = Data bank 0 (000H - 07FH) 001 = Data bank 1 (080H - 0FFH) 010 = Data bank 2 (100H - 17FH) 011 = Data bank 3 (180H - 1FFH) 100 = Data bank 4 (200H - 27FH) 101 = Data bank 5 (280H - 2FFH) 110 = Data bank 6 (300H - 37FH) 111 = Data bank 7 (380H - 3FFH)
6.5 Accumulator (ACC)
The accumulator (ACC) is a 4-bit register used to hold results from the ALU and transfer data between the memory, I/O ports, and registers.
6.6 Arithmetic and Logic Unit (ALU)
This is a circuit which performs arithmetic and logic operations. The ALU provides the following functions: * Logic operations: ANL, XRL, ORL * Branch decisions: JB0, JB1, JB2, JB3, JNZ, JZ, JC, JNC, DSKZ, DSKNZ, SKB0, SKB1, SKB2, SKB3 * Shift operations: SHRC, RRC, SHLC, RLC * Binary additions/subtractions:ADC, SBC, ADD, SUB, ADU, DEC, INC After any of the above instructions are executed, the status of the carry flag (CF) and zero flag (ZF) is stored in the internal registers. CF can be read out by executing MOV R, CF.
6.7 Oscillator
The W742C814 provides a crystal oscillation circuit to generate the system clock through external connections. The 32768 Hz crystal be connected to XIN and XOUT, and a capacitor must be connected to XIN and XOUT if an accurate frequency is needed.
XIN Crystal 32768 Hz XOUT
Figure 6-3
System Clock Oscillator Configuration
- 11 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
6.8 Dividers
Each divider is organized as a 14-bit binary up-counter designed to generate periodic interrupts. When the main oscillator starts action, the Divider0 is incremented by each clock (FOSC). When an overflow occurs, the Divider0 event flag is set to 1 (EVF.0 = 1). Then, if the Divider0 interrupt enable flag has been set (IEF.0 = 1), the interrupt is executed, while if the hold release enable flag has been set (HEF.0 = 1), the hold state is terminated. And the last 4-stage of the Divider0 can be reset by executing CLR DIVR0 instruction. If the Fslow-oscillator starts action, the Divider1 is incremented by each clock. When an overflow occurs, the Divider1 event flag is set to 1 (EVF.4 = 1). Then, if the Divider1 interrupt enable flag has been set (IEF.4 = 1), the interrupt is executed, while if the hold release enable flag has been set (HEF.4 = 1), the hold state is terminated. And the last 4-stage of the Divider1 can be reset by executing CLR DIVR1 instruction. Same as EVF.0, the EVF.4 is set to 1 periodically. But there are two period time (125 mS & 500 mS) that can be selected by setting the SCR.3 bit. When SCR.3 = 0 (default), the 500 mS period time is selected; SCR.3 = 1, the 125 mS period time is selected.
6.9 Dual-clock Operation
In the dual-clock mode, before the STOP instruction is executing, the LCD must be turned off. the normal operation is performed by generating the system clock from the Fslow-oscillator clock. As required, the fast operation can be performed by generating the system clock from the Ffast-oscillator clock. The exchange of the normal operation and the fast operation is performed by setting the bit 0 of the System clock Control Register (SCR). If the SCR.0 is reset to 0, the clock source of the system clock generator is Fslow-oscillator clock; if the SCR.0 is set to 1, the clock source of the system clock generator is Ffast-oscillator clock. In the dual-clock mode, the Fosc-oscillator can stop oscillating when the STOP instruction is executing or the SCR.1 is set to 1. When the SCR is set or reset, we must care the following cases: 1. XX00B XX11B: we should not exchange the FOSC from Fslow into Ffast and enable Ffast simultaneously. We could first the SCR.1 is set to 1 to enable PLL, the 2nd step is calling a delay subroutine to wait the Ffast-oscillator oscillating stably; then exchange the FOSC from Fslow into Ffast is the last step. So it should be XX00BXX10Bdelay the Ffast oscillating stably timeXX11B. The suggestion of the Ffast oscillating stably time is 25 mS(Min.) for PLL stable output 3.6042 MHz. 2. X011B X000B: we should not exchange Fosc from Ffast into Fslow and disable Ffast simultaneously. exchange the FOSC from Fs into Fm simultaneously. We could first exchange the Fosc from Ffast into Fslow, then disable the PLL. So it should be XX11B XX10B XX00B. We must remember that the XX01B state is inhibitive, because it will induce the system shutdown.
- 12 -
W742C814
The organization of the dual-clock operation mode is shown in Figure 6-4.
S C R .0
HOLD
Fosc
X IN XOUT
O s c illa to r
F s lo w
F s lo w F fa s t
S y s te m C lo c k G e n e ra to r D iv id e r 0
T1 T2 T3 T4
STOP
PLL
F s lo w S C R .1 e n a b le /d is a b le F s lo w
L C D F re q u e n c y S e le c to r D iv id e r 1
IN T 4 H C F .4
F lc d
S C R .3 (1 4 /1 2 b it)
S C R : S y s te m c lo c k C o n tr o l R e g is te r (d e fa u lt = 0 0 h ) B it3 B it1 B it0 0 1 0 1 : : : : Fosc F osc PLL PLL = F s lo w = F fa s t d is a b le e n a b le
0 : 1 4 b it 1 : 1 2 b it D u a l c lo c k o p e ra tio n m o d e : - S C R .0 = 0 , F o s c = F s lo w ; S C R .0 = 1 , F o s c = F f a s t - In S T O P m o d e L C D is tu rn e d o ff - S C R v a lu e w ill b e re s e t a s X X 0 0 B a fte r w a k e u p f ro m S T O P m o d e
Figure 6-4
Organization of the dual-clock operation mode
6.10 WatchDog Timer (WDT) and WatchDog Timer Register (WDTR)
The watchdog timer (WDT) is organized as a 4-bit up counter designed to prevent the program from unknown errors. When the corresponding option code bit of the WDT set to 1, the WDT is enabled, and if the WDT overflows, the chip will be reset. At initial reset, the input clock of the WDT is FOSC/2048. The input clock of the WDT can be switched to FOSC/16384 (or FOSC/2048) by setting WDTR.3 to 1. The contents of the WDT can be reset by the instruction CLR WDT. In normal operation, the application program must reset WDT before it overflows. A WDT overflow indicates that operation is not under control and the chip will be reset. The WDT overflow period is 1 S when the sub-system clock (Fslow) is 32 KHz and WDT clock input is Fslow/2048. When the corresponding option code bit of the WDT set to 0, the WDT function is disabled. The organization of the Divider0 and watchdog timer is shown in Figure 6-5.
- 13 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
Divider0
Fosc
Q1 Q2
HEF.0
S R Q
... Q9
Q10 Q11 Q12 Q13 Q14
EVF.0
IEF.0
Hold mode release (HCF.0) Divider interrupt (INT0)
WDTR.3 Fosc/16384 Fosc/2048
Option code is "0" WDTR.2 Disable
1. Reset 2. CLR EVF,#01H 3. CLR DIVR0
WDT
Overflow signal 1. Reset 2. CLR WDT System Reset
R R R R
Qw1 Qw2 Qw3 Qw4
Fslow/16384 Fslow/2048
Enable Option code is "1"
Fslow
Q1 Q2
Divider1 ... Q9
Q10 Q11 Q12 Q13 Q14
S R Q
HEF.4 EVF.4 IEF.4
Hold mode release (HCF.4) Divider interrupt (INT1)
SCR.3
1. Reset 2. CLR EVF,#10H 3. CLR DIVR1
Figure 6-5 Organization of Divider0, Divider1 and WatchDog Timer
3 WDTR R/W
2 R/W
1 R/W
0 R
Note: R/W means read/write available, R means read only. Power On reset default is: 0000
Bit 3 Bit 2 Bit 1 Bit 0
=0 =1 =0 =1 =0 =1 =0 =1
FOSC/2048(Select Divider0) or Fslow/2048(Select Divider1) as the WDT source. FOSC/16384(Select Divider0) or Fslow/16384(Select Divider1) as the WDT source. Select Divider0. Select Divider1. Refer to Table 2. Refer to Table 2. No time out. Time out.
- 14 -
W742C814
WDTR.0 will be set to one when WDT time out and can be reset to zero by: POWER ON RESET, RESET PIN, CLR WDT Table 2. The bit 1 of WatchDog Timer Register (WDTR) reset item
WDTR.1 = 1 WDTR.1 = 0
RESET ITEM
Program Counter (PC) Stack Pointer (SP) ROMPR, PAGE, DBKR, WRP, ACC, CF, ZF, SCR Registers IEF, HEF, SEF, HCF, PEF, EVF Flags DIV0, DIV1 TM0, TM1, MR0, MR1 Registers Timer 0 Input Clock Timer 1 Input Clock MFP Output PM0 Register PM1, PM2, PM5 Registers PSR0 Register Input/Output Orts RA, RB, RD Output Ports RE RA, RB Ports Output Type RC Port Pull-high Resistors Input Clock of the Watchdog Timer DTMF Output BUZCR Register FLCD LCD Display LCDR Segment Output Mode
-: keep the status Note: SCR.2 is reserved
0000H IEF = Reset -
0000H Reset Reset Reset Reset Reset FOSC/4 FOSC Low Reset Set (1111B) Reset Input mode High CMOS type Disable FOSC/2048 Hi-Z Reset Q5 to Q9 Reset OFF Reset LCD drive output
6.11 Timer/Counter
6.11.1 Timer 0 (TM0)
Timer 0 (TM0) is a programmable 8-bit binary down-counter. The specified value can be loaded into TM0 by executing the MOV TM0L(TM0H),R instructions. When the MOV TM0L(TM0H),R instructions are executed, it will stop the TM0 down-counting (if the TM0 is down-counting) and reset the MR0.3 to Publication Release Date: February 12, 2003 Revision A2
- 15 -
W742C814
0, and the specified value can be loaded into TM0. Then we can set MR0.3 to 1, that will cause the event flag 1 (EVF.1) is reset and the TM0 starts to count. When it decreases and underflow to FFH, Timer 0 stops operating and generates an underflow (EVF.1 = 1). Then, if the Timer 0 interrupt enable flag has been set (IEF.1 = 1), the interrupt is executed, while if the hold release enable flag 1 has been set (HEF.1 = 1), the hold state is terminated. The Timer 0 clock input can be set as FOSC/1024 or FOSC/4 by setting MR0.0 to 1 or resetting MR0.0 to 0. The default timer value is FOSC/4. The organization of Timer 0 is shown in Figure 6-6. If the Timer 0 clock input is FOSC/4: Desired Timer 0 interval = (preset value +1) x 4 x 1/FOSC If the Timer 0 clock input is FOSC/1024: Desired Timer 0 interval = (preset value +1) x 1024 x 1/FOSC Preset value: Decimal number of Timer 0 preset value FOSC: Clock oscillation frequency
1. Reset 2. CLR EVF,#02H 3. Reset MR0.3 to 0 4.MOV TM0L,R or MOV TM0H,R MR0.0 Fosc/1024 Fosc/4 Enable Set MR0.3 to 1 MOV TM0H,R MOV TM0L,R 1. Reset 2. CLR EVF,#02H 3.Set MR0.3 to 1 Disable 8-Bit Binary Down Counter (Timer 0) 4 4 HEF.1 S R Q EVF.1 IEF.1 Timer 0 interrupt (INT1) Hold mode release (HCF.1)
Figure 6-6
Organization of Timer 0
6.11.2 Timer 1 (TM1)
Timer 1 (TM1) is also a programmable 8-bit binary down counter, as shown in Figure 6-7. Timer 1 can be used as to output an arbitrary frequency to the MFP pin. The input clock of Timer 1 can be one of three sources: FOSC/64, FOSC, or Fslow. The source can be selected by setting bit 0 and bit 1 of mode register 1 (MR1). At initial reset, the Timer 1 clock input is FOSC. When the MOV TM1L, R or MOV TM1H,R instruction is executed, the specified data are loaded into the auto-reload buffer; but the TM1 down-counting will keep going on. If the bit 3 of MR1 is set (MR1.3 = 1), the content of the auto-reload buffer will be loaded into the TM1 down counter, and Timer 1 starts to down count, and the event flag 7 is reset (EVF.7=0). When the timer decreases and underflow to FFH, it will generate an underflow (EVF.7 = 1) and be auto-reloaded with the specified data, after which it will continue to count down. Then, if interrupt enable flag 7 has been set to 1 (IEF.7 = 1), an interrupt is executed; if hold mode
- 16 -
W742C814
release enable flag 7 is set to 1 (HEF.7 = 1), the hold state is terminated. The specified frequency of Timer 1 can be delivered to the MFP output pin by programming bit 2 of MR1. Bit 3 of MR1 can be used to make Timer 1 stop or start counting. In a case where Timer 1 clock input is FT: Desired Timer 1 interval = (preset value +1) / FT Desired frequency for MFP output pin = FT / (preset value + 1) / 2 (Hz) Preset value: Decimal number of Timer 1 preset value FOSC: Clock oscillation frequency
MOV TM1H,R 4 MR1.3
MOV TM1L,R 4 S R Q EVF.7 1. Reset 2. INT7 accept 3. CLR EVF, #80H 4. Set MR1.3 to 1
Auto-reload buffer Enable FT 8 bits 8-Bit Binary Down Counter (Timer 1) Disable 8 bits Reset MOV WR,TM1
Fslow Fosc/64 Fosc MR1.0
Underflow signal
2
circuit MFP signal MFP output pin BUZCR.0
MR1.1
Reset Set MR1.3 to 1
Figure 6-7
Organization of Timer 1
For example, when FT equals 32768 Hz, depending on the preset value of TM1, the MFP pin will output a single tone signal in the tone frequency range from 64 Hz to 16384 Hz. The relation between the tone frequency and the preset value of TM1 is shown in the table below. MOV WR, TM1 can read back the content of TM1, It will save the TM1 MSB to WR and the TM1 LSB to ACC.
- 17 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
Table 3. The relation between the tone frequency and the present value of TM1
3rd octave
Tone frequency TM1 preset value & MFP frequency 7CH 75H 6FH 68H 62H 5DH 58H 53H 4EH 49H 45H 41H 131.07 138.84 146.28 156.03 165.49 174.30 184.09 195.04 207.39 221.40 234.05 248.24
4th octave
Tone frequency 261.63 277.18 293.66 311.13 329.63 349.23 369.99 392.00 415.30 440.00 466.16 493.88 TM1 preset value & MFP frequency 3EH 3AH 37H 34H 31H 2EH 2BH 29H 26H 24H 22H 20H 260.06 277.69 292.57 309.13 327.68 348.58 372.35 390.09 420.10 442.81 468.11 496.48
5th octave
Tone frequency 523.25 554.37 587.33 622.25 659.26 698.46 739.99 783.99 830.61 880.00 932.23 987.77 TM1 preset value & MFP frequency 1EH 1CH 1BH 19H 18H 16H 15H 14H 13H 12H 11H 10H 528.51 564.96 585.14 630.15 655.36 712.34 744.72 780.19 819.20 862.84 910.22 963.76
C C#
130.81 138.59 146.83 155.56 164.81 174.61 185.00 196.00 207.65 220.00 233.08 246.94
T O N E
D D# E F F# G G# A A# B
Note: Central tone is A4 (440 Hz).
6.11.3 Mode Register 0 (MR0)
Mode Register 0 is organized as a 4-bit binary register (MR0.0 to MR0.3). MR0 can be used to control the operation of Timer 0. The bit descriptions are as follows:
3 MR0
Note: W means write only.
2
1
0 W
W
Bit 0
=0 =1
The fundamental frequency of Timer 0 is FOSC/4. The fundamental frequency of Timer 0 is FOSC/1024. Timer 0 stops down-counting. Timer 0 starts down-counting.
Bit 1 & Bit 2 are reserved Bit 3 =0 =1
6.11.4 Mode Register 1 (MR1) & MFP Control Pin (BUZCR)
Mode Register 1 is organized as a 4-bit binary register (MR1.0 to MR1.3). MR1 can be used to control the operation of Timer 1. The bit descriptions are as follows:
3 MR1
Note: W means write only.
2 W
1 W
0 W
W
- 18 -
W742C814
The internal fundamental frequency of Timer 1 is FOSC. The internal fundamental frequency of Timer 1 is FOSC/64. Bit 1 The fundamental frequency source of Timer 1 is the internal clock. The fundamental frequency source of Timer 1 is the Fslow-oscillator frequency Fslow (32768 Hz). Bit 2 is reserved. Bit 3 =0 =1 Timer 1 stops down-counting. Timer 1 starts down-counting. Bit 0 =0 =1 =0 =1
MFP control pin is organized as a 4-bit binary register.
3 BUZCR 2 1 0 W
Note: W means write only.
Bit 0
=0 The specified waveform of the MFP generator is delivered to the MFP output pin. =1 The specified frequency of Timer 1 is delivered to the MFP output pin. Bit 1, Bit 2 & Bit 3 are reserved.
6.12 Interrupts
The W742C814 provides four internal interrupt sources (Divider 0, Divider 1, Timer 0, Timer 1) and one external interrupt source (port RC). Vector addresses for each of the interrupts are located in the range of program memory (ROM) addresses 004H to 020H. The flags IEF, PEF, and EVF are used to control the interrupts. When EVF is set to "1" by hardware and the corresponding bits of IEF and PEF have been set by software, an interrupt is generated. When an interrupt occurs, all of the interrupts are inhibited until the EN INT or MOV IEF,#I instruction is invoked. The interrupts can also be disabled by executing the DIS INT instruction. When an interrupt is generated in hold mode, the hold mode will be released momentarily and interrupt subroutine will be executed. After the RTN instruction is executed in an interrupt subroutine, the C will enter hold mode again. The operation flow chart is shown in Figure 6-9. The control diagram is shown in Figure 6-8.
- 19 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
Divider 0 overflow signal
EN INT MOV IEF,#I S R Q EVF.0
Initial Reset Enable 004H
IEF.0 EVF.1 IEF.1 EVF.2 IEF.2 EVF.4 IEF.4 EVF.7 IEF.7 Interrupt Process Circuit Interrupt Vector Generator
Timer 0 underflow signal
S R
Q
008H
RC port signal change
S R
Q
00CH
Divider 1 overflow signal
S R
Q
014H
Timer 1 underflow signal
S R
Q
020H
Initial Reset CLR EVF,#I instruction
Disable DIS INT instruction
Figure 6-8
Interrupt event control diagram
6.13 Stop Mode Operation
In stop mode, all operations of the C cease, and the MFP pin is kept to high. The C enters stop mode when the STOP instruction is executed and exits stop mode when an external trigger is activated (by a falling signal on the RC). When the designated signal is accepted, the C awakens and executes the next instruction. To prevent erroneous execution, the NOP instruction should follow the STOP command. But In the dual-clock slow operation mode, the STOP instruction will also disable the Fslow-oscillator oscillating; the C system will be all cease. By the way, the SCR value will be reset as XX00B when C was wakeup in STOP mode. User should update the SCR value by self.
6.13.1 Stop Mode Wake-up Enable Flag for RC Port (SEF)
The stop mode wake-up flag for port RC is organized as an 4-bit binary register (SEF.0 to SEF.3). Before port RC may be used to make the device exit the stop mode, the content of the SEF must be set first. The SEF is controlled by the MOV SEF, #I instruction. The bit descriptions are as follows:
3 SEF
Note: W means write only.
2 w
1 w
0 w
w
- 20 -
W742C814
SEF.0 = 1 SEF.1 = 1 SEF.2 = 1 SEF.3 = 1 Device will exit stop mode when falling edge signal is applied to pin RC.0 Device will exit stop mode when falling edge signal is applied to pin RC.1 Device will exit stop mode when falling edge signal is applied to pin RC.2 Device will exit stop mode when falling edge signal is applied to pin RC.3
6.14 Hold Mode Operation
In hold mode, all operations of the C cease, except for the operation of the oscillator, Timer, Divider, LCD driver, DTMF generator and MFP generator. The C enters hold mode when the HOLD instruction is executed. The hold mode can be released in one of five ways: by the action of timer 0, timer 1, divider 0, divider 1, the RC port. Before the device enters the hold mode, the HEF, PEF, and IEF flags must be set to define the hold mode release conditions. For more details, refer to the instruction-set table and the following flow chart.
Divider 0, Divider 1, Timer 0, Timer 1, Signal Change at RC Port
Yes
In HOLD Mode?
No
Interrupt Enable? Yes
No
Interrupt Enable? Yes
No
IEF Flag Set? Yes Reset EVF Flag Execute Interrupt Service Routine (Note) Disable interrupt
No
IEF Flag Set? Yes Reset EVF Flag Execute Interrupt Service Routine Yes
No
HEF Flag Set? No
(Note)
Disable interrupt
HOLD Note: The bit of EVF corresponding to the interrupt signal will be reset.
Figure 6-9
PC <- (PC+1)
Hold Mode and Interrupt Operation Flow Chart
- 21 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
6.14.1 Hold Mode Release Enable Flag (HEF)
The hold mode release enable flag is organized as an 8-bit binary register (HEF.0 to HEF.7). The HEF is used to control the hold mode release conditions. It is controlled by the MOV HEF, #I instruction. The bit descriptions are as follows:
7 HEF
Note: W means write only.
6
5
4 w
3
2 w
1 w
0 w
w
HEF.0 = 1 HEF.1 = 1 HEF.2 = 1 HEF.4 = 1 HEF.7 = 1
Overflow from the Divider 0 causes Hold mode to be released. Underflow from Timer 0 causes Hold mode to be released. Signal change at port RC causes Hold mode to be released. Overflow from the Divider 1 causes Hold mode to be released. Underflow from Timer 1 causes Hold mode to be released.
HEF.3, HEF.5 & HEF.6 are reserved.
6.14.2 Interrupt Enable Flag (IEF)
The interrupt enable flag is organized as a 8-bit binary register (IEF.0 to IEF.7). These bits are used to control the interrupt conditions. It is controlled by the MOV IEF, #I instruction. When one of these interrupts is accepted, the corresponding to the bit of the event flag will be reset, but the other bits are unaffected. In interrupt subroutine, these interrupts will be disable till the instruction MOV IEF, #I or EN INT is executed again. Otherwise, these interrupts can be disable by executing DIS INT instruction. The bit descriptions are as follows:
7 IEF
Note: W means write only.
6
5
4 w
3
2 w
1 w
0 w
w
IEF.0 = 1 IEF.1 = 1 IEF.2 = 1 IEF.4 = 1 IEF.7 = 1
Interrupt 0 is accepted by overflow from the Divider 0. Interrupt 1 is accepted by underflow from the Timer 0. Interrupt 2 is accepted by a signal change at port RC. Interrupt 4 is accepted by overflow from the Divider 1. Interrupt 7 is accepted by underflow from Timer 1.
IEF.3, IEF.5 & IEF.6 are reserved.
6.14.3 Port Enable Flag (PEF)
The port enable flag is organized as 4-bit binary register (PEF.0 to PEF.3). Before port RC may be used to release the hold mode or preform interrupt function, the content of the PEF must be set first. The PEF is controlled by the MOV PEF, #I instruction. The bit descriptions are as follows:
- 22 -
W742C814
3 PEF
Note: W means write only.
2 w
1 w
0 w
w
PEF.0: Enable/disable the signal change at pin RC.0 to release hold mode or perform interrupt. PEF.1: Enable/disable the signal change at pin RC.1 to release hold mode or perform interrupt. PEF.2: Enable/disable the signal change at pin RC.2 to release hold mode or perform interrupt. PEF.3: Enable/disable the signal change at pin RC.3 to release hold mode or perform interrupt.
6.14.4 Hold Mode Release Condition Flag (HCF)
The hold mode release condition flag is organized as a 8-bit binary register (HCF.0 to HCF.7). It indicates by which interrupt source the hold mode has been released, and is loaded by hardware. The HCF can be read out by the MOVA R, HCFL and MOVA R, HCFH instructions. When any of the HCF bits is "1," the hold mode will be released and the HOLD instruction is invalid. The HCF can be reset by the CLR EVF or MOV HEF, #I (HEF = 0) instructions. When EVF and HEF have been reset, the corresponding bit of HCF is reset simultaneously. The bit descriptions are as follows:
7 HCF
Note: R means read only.
6
5 R
4 R
3
2 R
1 R
0 R
HCF.0 = 1 HCF.1 = 1 HCF.2 = 1 HCF.4 = 1 HCF.5 = 1
Hold mode was released by overflow from the divider 0. Hold mode was released by underflow from the timer 0. Hold mode was released by a signal change at port RC. Hold mode was released by overflow from the divider 1. Hold mode was released by underflow from the timer 1.
HCF.3 is reserved.
HCF.6 and HCF.7 are reserved.
6.14.5 Event Flag (EVF)
The event flag is organized as a 8-bit binary register (EVF.0 to EVF.7). It is set by hardware and reset by CLR EVF, #I instruction or the occurrence of an interrupt. The bit descriptions are as follows:
7 EVF
Note: R means read only.
6
5
4 R
3
2 R
1 R
0 R
R
- 23 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
EVF.0 = 1 EVF.1 = 1 EVF.2 = 1 EVF.4 = 1 EVF.7 = 1 Overflow from divider 0 occurred. Underflow from timer 0 occurred. Signal change at port RC occurred. Overflow from divider 1 occurred. Underflow from Timer 1 occurred.
EVF.3 is reserved. EVF.5 & EVF.6 are reserved.
6.15 Reset Function
The W742C81D has build-in power-on reset circuit to control level of reset signal generation when VDD power down by external resistor R1 &R2 is shown in Figure 6-10.
VDD V re se t
R eset VDD R1 V re se t R2 V re f R eset R eset
V re se t
R2 VDD R 1+R 2
V re f 1 V
Figure 6-10
Architecture of Power-on reset circuit
- 24 -
W742C814
The W742C81D is reset either by a power-on reset or by using the external RES pin. The initial state of the W742C81D after the reset function is executed is described below Table 4. Table 4. The initial state after the reset function is executed Program Counter (PC) WDTR Registers BUZCR Registers ACC, CF, ZF Registers MR0, MR1, PAGE Registers PSR0, SCR, TM0, TM1 Registers IEF, HEF, HCF, PEF, EVF, SEF Flags WRP, DBKR, PAGE Registers Timer 0 Input Clock Timer 1 Input Clock MFP Output DTMF Output Input/Output Ports RA, RB, RD Output Port RE RA, RB Ports Output Type RC Ports Pull-high Resistors Input Clock of the Watchdog Timer LCD Display 000H Reset Reset Reset Reset Reset Reset Reset FOSC/4 FOSC Low Hi-Z Input mode High CMOS type Disable FOSC/2048 OFF
6.16 Input/Output Ports RA, RB & RD
Port RA consists of pins RA.0 to RA.3. Port RB consists of pins RB.0 to RB.3. Port RD consists of pins RD.0 to RD.3. At initial reset, input/output ports RA, RB and RD are all in input mode. When RA, RB are used as output ports, CMOS or NMOS open drain output type can be selected by the PM0 register. But when RD is used as output port, the output type is just fixed to be CMOS output type. Each pin of port RA, RB and RD can be specified as input or output mode independently by the PM1, PM2 and PM5 registers. The MOVA R, RA or MOVA R, RB or MOVA R, RD instructions operate the input functions and the MOV RA, R or MOV RB, R or MOV RD, R operate the output functions. For more details, refer to the instruction table and Figure 6-11 and Figure 6-12.
- 25 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
Input/Output Pin of the RA(RB)
PM0.0(PM0.1)
DATA BUS
Output Buffer
Enable
I/O PIN RA.n(RB.n)
PM1.n (PM2.n)
MOV RA,R(MOV RB,R) instruction
Enable
MOVA R,RA(MOVA R,RB) instruction
Figure 6-11
Architecture of RA (RB) Input/Output Pins
Input/Output Pin of the RD
DATA BUS
Output Buffer
Enable
I/O PIN RD.n
PM5.n
MOV RD,R instruction
Enable
MOVA R,RD instruction
Figure 6-12
Architecture of RD Input/Output pins
6.16.1 Port Mode 0 Register (PM0)
The port mode 0 register is organized as 4-bit binary register (PM0.0 to PM0.3). PM0 can be used to determine the structure of the input/output ports; it is controlled by the MOV PM0, #I instruction. The bit descriptions are as follows:
3 PM0
Note: W means write only.
2 w
1 w
0 w
w
Bit 0 = 0 Bit 1 = 0 Bit 2 = 0
RA port is CMOS output type. RB port is CMOS output type.
Bit 0 = 1 Bit 1 = 1
RA port is NMOS open drain output type. RB port is NMOS open drain output type. RC port pull-high resistor is enabled.
RC port pull-high resistor is disabled. Bit 2 = 1
Bit 3 is reserved.
- 26 -
W742C814
6.16.2 Port Mode 1 Register (PM1)
The port mode 1 register is organized as 4-bit binary register (PM1.0 to PM1.3). PM1 can be used to control the input/output mode of port RA. PM1 is controlled by the MOV PM1, #I instruction. The bit descriptions are as follows:
3 PM1
Note: W means write only.
2 w
1 w
0 w
w
Bit 0 = 0 Bit 1 = 0 Bit 2 = 0 Bit 3 = 0
RA.0 works as output pin; Bit 0 = 1 RA.1 works as output pin; Bit 1 = 1 RA.2 works as output pin; Bit 2 = 1 RA.3 works as output pin; Bit 3 = 1
RA.0 works as input pin RA.1 works as input pin RA.2 works as input pin RA.3 works as input pin
At initial reset, port RA is input mode (PM1 = 1111B).
6.16.3 Port Mode 2 Register (PM2)
The port mode 2 register is organized as 4-bit binary register (PM2.0 to PM2.3). PM2 can be used to control the input/output mode of port RB. PM2 is controlled by the MOV PM2, #I instruction. The bit descriptions are as follows:
3 PM2
Note: W means write only.
2 w
1 w
0 w
w
Bit 0 = 0 RB.0 works as output pin; Bit 0 = 1 RB.0 works as input pin Bit 1 = 0 RB.1 works as output pin; Bit 1 = 1 RB.1 works as input pin Bit 2 = 0 RB.2 works as output pin; Bit 2 = 1 RB.2 works as input pin Bit 3 = 0 RB.3 works as output pin; Bit 3 = 1 RB.3 works as input pin At initial reset, the port RB is input mode (PM2 = 1111B).
6.16.4 Port Mode 5 Register (PM5)
The port mode 5 register is organized as 4-bit binary register (PM5.0 to PM5.3). PM5 can be used to control the input/output mode of port RD. PM5 is controlled by the MOV PM5, #I instruction. The bit descriptions are as follows:
3 PM5
Note: W means write only.
2 w
1 w
0 w
w
Bit 0 = 0 RD.0 works as output pin; Bit 0 = 1 RD.0 works as input pin Bit 1 = 0 RD.1 works as output pin; Bit 1 = 1 RD.1 works as input pin Bit 2 = 0 RD.2 works as output pin; Bit 2 = 1 RD.2 works as input pin Bit 3 = 0 RD.3 works as output pin; Bit 3 = 1 RD.3 works as input pin At initial reset, the port RD is input mode (PM5 = 1111B). Publication Release Date: February 12, 2003 Revision A2
- 27 -
W742C814
6.17 Input Ports RC
Port RC consists of pins RC.0 to RC.3. Each pin of port RC can be connected to a pull-up resistor, which is controlled by the port mode 0 register (PM0). When the PEF, HEF, and IEF corresponding to the RC port are set, a signal change at the specified pins of port RC will execute the hold mode release or interrupt subroutine. Port status register 0 (PSR0) records the status of ports RC, i.e., any signal changes on the pins that make up the ports. PSR0 can be read out and cleared by the MOV R, PSR0, and CLR PSR0 instructions. In addition, the falling edge signal on the pin of port RC specified by the instruction MOV SEF, #I will cause the device to exit the stop mode. Refer to Figure 6-13 and the instruction table for more details.
DATA BUS PM0.2 Signal change detector PEF.0 D RC.0 ck R PSR0.0 Q
HEF.2 PM0.2 Signal change detector PEF.1 D RC.1 ck R PSR0.1 Q EVF.2 D ck R IEF.2 Q
HCF.2
INT 2
PM0.2 Signal change detector PEF.2 D RC.2 ck R Q PSR0.2
CLR EVF, #I Reset
PM0.2 Signal change detector
PEF.3 D Q PSR0.3
RC.3
ck R
SEF.0 Falling Edge detector SEF.1 Falling Edge detector SEF.2 Falling Edge detector SEF.3 Falling Edge detector
Reset MOV PEF, #I CLR PSR0
To Wake Up Stop Mode
Figure 6-13
Architecture of Input Ports RC
- 28 -
W742C814
6.17.1 Port Status Register 0 (PSR0)
Port status register 0 is organized as 4-bit binary register (PSR0.0 to PSR0.3). PSR0 can be read or cleared by the MOVA R, PSR0, and CLR PSR0 instructions. The bit descriptions are as follows:
3 PSR0
Note: R means read only.
2 R
1 R
0 R
R
Bit 0 = 1 Bit 1 = 1 Bit 2 = 1 Bit 3 = 1
Signal change at RC.0 Signal change at RC.1 Signal change at RC.2 Signal change at RC.3
6.18 Output Port RE
Output port RE is used as an output of the internal RT port. When the MOV RE, R instruction is executed, the data in the RAM will be output to port RT through port RE. It provides a high sink current to drive an LED.
6.19 DTMF Output Pin (DTMF)
To use this DTMF function should enable PLL first SCR.1 set as "1" at least 25mS, This pin should output the dual tone multi-frequency signal from the DTMF generator. There is the DTMF register that can specify the wanted low/high frequency. And control whether the dual tone will be output or not. The tones are divided into two groups (Row group and Col group) and one tone from each group is selected to represent a digit. The relation between the DTMF signal and the corresponding touch tone keypad is shown in Figure 6-14.
C1 R1 1
C2 2
C3 3
C4 A Row/Col R1 R2 Frequency 697 Hz 770 Hz 852 Hz 941 Hz 1209 Hz 1336 Hz 1477 Hz 1633 Hz
R2
4
5
6
B
R3 R4 C1 C2 C3 C4
R3
7
8
9
C
R4
*
0
#
D
Figure 6-14
The relation between the touch tone keypad and the frequency
- 29 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
6.19.1 DTMF Register
DTMF register is organized as 4-bit binary register. By controlling the DTMF register, one tone of the low/high group can be selected. The MOV DTMF, R instruction can specify the wanted tones. The bit descriptions are as follows:
3 DTMF
Note: W means write only.
2 W
1 W
0 W
W
B3
B2
B1
B0
SELECTED TONE
X High Group X X X 0 Low Group 0 1 1
X X X X 0 1 0 1
0 0 1 1 X X X X
0 1 0 1 X X X X
1209 Hz 1336 Hz 1477 Hz 1633 Hz 697 Hz 770 Hz 852 Hz 941 Hz
Note: X means this bit do not care.
6.19.2 Dual Tone Control Register (DTCR)
Dual tone control register is organized as 4-bit binary register. The output of the dual or single tone will be controlled by this register. The MOV DTCR, #I instruction can specify the wanted status. The bit descriptions are as follows:
3 DTCR
Note: W means write only.
2 W
1 W
0 W
Bit 0 = 1 Low group tone output is enabled. Bit 1 = 1 High group tone output is enabled. Bit 2 = 1 DTMF output is enabled. When Bit 2 is reset to 0, the DTMF output pin will be Hi-Z state. Bit 3 is reserved.
6.20 MFP Output Pin (MFP)
The MFP output pin can output the Timer 1 clock or the modulation frequency; the output of the pin is determined by bit 0 of BUZCR (BUZCR.0). The organization of MR1 is shown in Figure 6-7. When bit 0 of BUZCR is reset to "0," the MFP output can deliver a modulation output in any combination of one signal from among DC, 4096 Hz, 2048 Hz, and one or more signals from among 128 Hz, 64 Hz, 8 Hz, 4 Hz, 2 Hz, or 1 Hz (when using a 32.768 KHz crystal). The MOV MFP, #I instruction is used to specify the modulation output combination. The data specified by the 8-bit operand and the MFP output pin are shown in next page.
- 30 -
W742C814
Table 5. The relation between the MFP output frequncy and the data specified by 8-bit operand
(Fosc = 32.768 KHz)
R7 R6
R5
R4
R3
R2
R1
R0
FUNCTION
0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0 1
0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0
0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0
0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0
0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0
0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0
Low level 128 Hz 64 Hz 8 Hz 4 Hz 2 Hz 1 Hz High level 128 Hz 64 Hz 8 Hz 4 Hz 2 Hz 1 Hz 2048 Hz 2048 Hz * 128 Hz 2048 Hz * 64 Hz 2048 Hz * 8 Hz 2048 Hz * 4 Hz 2048 Hz * 2 Hz 2048 Hz * 1 Hz 4096 Hz 4096 Hz * 128 Hz 4096 Hz * 64 Hz 4096 Hz * 8 Hz 4096 Hz * 4 Hz 4096 Hz * 2 Hz 4096 Hz * 1 Hz
- 31 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
6.21 LCD Controller/Driver
The W742C814 can directly drive an LCD with 32 segment output pins and 4 common output pins for a total of 32 x 4 dots. The LCD driving mode is 1/3 bias 1/4 duty. The alternating frequency of the LCD can be set as Fslow/64, Fslow/128, Fslow/256, or Fslow/512. The structure of the LCD alternating frequency (FLCD) is shown in the Figure 6-15.
Fslow
Q1
Q2
Q3
Q4
Q5
Q6
Q7
Q8
Q9
Fw/64 Fw/128 Fw/256 Fw/512
Selector
FLCD
Figure 6-15
LCD alternating frequency (FLCD) circuit diagram
Fslow = 32.768 KHz, the LCD frequency is as shown in the table below. Table 6. The relationship between the FLCD and the duty cycle LCD frequency 1/4 duty Fslow/64 (512Hz) 128 Hz Fslow/128 (256Hz) 64 Hz Fslow/256 (128Hz) 32 Hz Fslow/512 (64Hz) 16 Hz
Corresponding to the 32 LCD drive output pins, there are 32 LCD data RAM segments. Instructions such as MOV LPL,R, MOV LPH,R, MOV @LP,R, and MOV R,@LP are used to control the LCD data RAM. The data in the LCD data RAM are transferred to the segment output pins automatically without program control. When the bit value of the LCD data RAM is "1," the LCD is turned on. When the bit value of the LCD data RAM is "0," LCD is turned off. The contents of the LCD data RAM (LCDR) are sent out through the segment0 to segment32 pins by a direct memory access. The relation between the LCD data RAM and segment/common pins is shown below. Table 7. The reation between the LCDR and segment/common pins used as LCD drive output pins COM3 COM2 COM1 COM0 LCD DATA RAM OUTPUT PIN BIT 3 BIT 2 BIT 1 BIT 0 LCDR00 SEG0 0/1 0/1 0/1 0/1 LCDR01 SEG1 0/1 0/1 0/1 0/1 : : : : : : : : : : : : LCDR1E SEG30 0/1 0/1 0/1 0/1 LCDR1F SEG31 0/1 0/1 0/1 0/1
- 32 -
W742C814
The LCDON instruction turns the LCD display on (even in HOLD mode), and the LCDOFF instruction turns the LCD display off. At initial reset, all the LCD segments are unlit. When the initial reset state ends, the LCD display is turned off automatically. To turn on the LCD display, the instruction LCDON must be executed.
6.21.1 LCD RAM addressing method
There are 32 LCD RAMs (LCDR00 - LCDR1F) that should be indirectly addressed. The LCD RAM pointer (LP) is used to point to the address of the wanted LCD RAM. The LP is organized as 6-bit binary register. The MOV LPL, R and MOV LPH, R instructions can load the LCD RAM address to the LP from R. The MOV @LP, R and MOV R, @LP instructions can access the pointed LCD RAM content.
6.21.2 The output waveforms for the LCD driving mode
1/3 bias 1/4 duty Lighting System (Example) Normal Operating Mode
COM0
VDD3 VDD2 VDD1 VSS VDD3 VDD2 VDD1 VSS
VDD3 VDD2 VDD1 VSS VDD3 VDD2 VDD1 VSS
VDD3 VDD2 VDD1 VSS
COM1
COM2
COM3
LCD driver outputs for only seg. on COM0 side being lit LCD driver outputs for only seg. on COM1 side being lit
VDD3 VDD2 VDD1 VSS
- 33 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
Continued
LCD driver outputs for seg. on COM0, COM1 sides being lit LCD driver outputs for seg. on COM1, COM2,3 sides being lit
VDD3 VDD2 VDD1 VSS
VDD3 VDD2 VDD1 VSS
LCD driver outputs for seg. on COM1 COM2 sides being lit LCD driver outputs for seg. on COM0 COM2,3 sides being lit LCD driver outputs for seg. on COM0 COM1,2,3 sides being lit
VDD3 VDD2 VDD1 VSS
VDD3 VDD2 VDD1 VSS
VDD3 VDD2 VDD1 VSS
- 34 -
W742C814
The power connections for the 1/3 bias 1/4 duty LCD driving mode are shown below.
1/3 Bias at VDD = 3.0 V DH1 0.1uF DH2 VSS C H I P
0.1uF
VDD VDD1 VDD2
VDD = 3.0 V
7. ABSOLUTE MAXIMUM RATINGS
PARAMETER RATING UNIT
Supply Voltage to Ground Potential Applied Input/Output Voltage Power Dissipation Ambient Operating Temperature Storage Temperature
-0.3 to +7.0 -0.3 to +7.0 120 0 to +70 -55 to +150
V V mW C C
Note: Exposure to conditions beyond those listed under Absolute Maximum Ratings may adversely affect the life and reliability of the device.
- 35 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
8. DC CHARACTERISTICS
(VDD - VSS = 3.0 V, Ffast = 3.579 MHz, Fslow = 32.768 KHz, TA = 25 C, LCD on; unless otherwise specified)
PARAMETER OP. VOLTAGE Op. Current (Crystal type)
SYM. VDD
CONDITIONS No load (Ext-V) In dual-clock normal operation No load (Ext-V) In dual-clock Fslow operation and Ffast is stopped Hold mode No load (Ext-V)
MIN. 2.4
TYP. -
MAX. 5.5
UNIT V
IOP1
-
0.9
2.5
mA
Op. Current (Crystal type)
IOP3
-
-
30
A
Hold Current (Crystal type)
IHM1
In dual-clock normal operation Hold mode No load (Ext-V)
-
-
450
A
Hold Current (Crystal type)
IHM3
In dual-clock Fslow operation and Ffast is stopped Stop mode No load (Ext-V) LCD driver be turned off IOL = 3.5 mA IOH = 3.5 mA IOL = 2.0 mA IOH = 2.0 mA All Seg. ON VOL = 0.4V VLCD = 0.0V VOH = 2.4V VLCD = 3.0V
-
11
25
A
Stop Current (Crystal type)
ISM1
-
7
12
A
Input Low Voltage Input High Voltage MFP Output Low Voltage MFP Output High Voltage Port RA, RB and RD Output Low Voltage Port RA, RB and RD Output high Voltage LCD Supply Current SEG0-SEG31 Sink Current (Used as LCD output) SEG0-SEG31 Drive Current (Used as LCD output)
VIL VIH VML VMH VABL VABH ILCD IOL1 IOH1
VSS 0.7VDD 2.4 2.4 90 90
-
0.3 VDD VDD 0.4 0.4 6 -
V V V V V V A A A
- 36 -
W742C814
DC Characteristics, continued
PARAMETER Port RE Sink Current Port RE Source Current DTMF Output DC Level DTMF Distortion DTMF Output Voltage Pre-emphasis DTMF Output Sink Current Pull-up Resistor
SYM. IEL IEH VTDC THD VTO ITL RC
CONDITIONS VOL = 0.9V VOH = 2.4V RL = 5 K, VDD = 2.5 to 3.8V RL = 5 K, VDD = 2.5 to 3.8V Low group, RL = 5 K Col/Row VTO = 0.5V Port RC
MIN. 9 0.4 1.1 130 1 0.2 100
TYP. 1.2 -30 150 2 350
MAX. 2.8 -23 170 3 1000
UNIT mA mA V dB mVrms dB mA K
9. AC CHARACTERISTICS
PARAMETER SYM. CONDITIONS MIN. TYP. MAX. UNIT
Op. Frequency Instruction Cycle Time Reset Active Width Interrupt Active Width
FOSC TI TRAW TIAW
Crystal type One machine cycle FOSC = 32.768 KHz FOSC = 32.768 KHz
1 1
32768 4/FOSC -
-
KHz S S S
- 37 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
10. INSTRUCTION SET TABLE
Symbol Description ACC: ACC.n: WR: WRP: PAGE: DBKR: ROMPR: MR0: MR1: PM0: PM1: PM2: PM5: PSR0: R: WDTR: LPL: LPH: R.n: SCR: BUZCR: RA: RC: DTMF: DTCR: MFP: Accumulator Accumulator bit n Working Register WR Page Register Page Register Data Bank Register ROM Page Register Mode Register 0 Mode Register 1 Port Mode 0 Port Mode 1 Port Mode 2 Port Mode 5 Port Status Register 0 Memory (RAM) of Address R WatchDog Timer Register LCD Data RAM Pointer LCD Data RAM Pointer Memory Bit n of Address R System Control Register Buzzer Control Register I/O Port RA I/O Port RC DTMF Register MTMF Control Pin MFP Output Pin
- 38 -
W742C814
Continued
I: L: CF: ZF: PC: TM0L: TM0H: TM1L: TM1H: TAB0: TAB1: TAB2: TAB3: IEF.n: HCF.n: HEF.n: SEF.n: PEF.n: EVF.n: ! =: &: ^: EX: : [PAGE*10H+()]: [P()]:
Constant Parameter Branch or Jump Address Carry Flag Zero Flag Program Counter Low Nibble of the Timer 0 counter High Nibble of the Timer 0 counter Low Nibble of the Timer 1 counter High Nibble of the Timer 1 counter Look-up Table Address Buffer 0 Look-up Table Address Buffer 1 Look-up Table Address Buffer 2 Look-up Table Address Buffer 3 Interrupt Enable Flag n HOLD Mode Release Condition Flag n HOLD Mode Release Enable Flag n STOP Mode Wake-up Enable Flag n Port Enable Flag n Event Flag n Not Equal AND OR Exclusive OR Transfer Direction, Result Contents of Address PAGE (bit2, bit1, bit0)*10H+() Contents of Port P
- 39 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
Instruction set, continued
Machine code Arithmetic 0001 1000 0001 1100 0001 1001 0001 1101 0000 1000 0000 1100 0000 1001 0000 1101 0010 1000 0010 1100 0010 1001 0010 1101 0001 1010 0001 1110 0001 1011 0001 1111 0000 1010 0000 1110 0000 1011 0000 1111 0100 1010 0100 1010 0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn 0xxxxxxx i i i i nnnn 0xxx xxxx 1xxx xxxx Mnemonic Function Flag affected W/C
ADD ADD ADDR ADDR ADC ADC ADCR ADCR ADU ADU ADUR ADUR SUB SUB SUBR SUBR SBC SBC SBCR SBCR INC DEC
R, ACC WRn, #I R, ACC WRn, #I R, ACC WRn, #I R, ACC WRn, #I R, ACC WRn, #I R, ACC WRn, #I R, ACC WRn, #I R, ACC WRn, #I R, ACC WRn, #I R, ACC WRn, #I R R
ACC(R) + (ACC) ACC(WRn) + I ACC, R(R) + (ACC) ACC, WRn(WRn) + I ACC(R) + (ACC) + (CF) ACC(WRn) + I + (CF) ACC, R(R) + (ACC) + (CF) ACC, WRn(WRn) + I + (CF) ACC(R) + (ACC) ACC(WRn) + I ACC, R(R) + (ACC)
ZF, CF ZF, CF ZF, CF ZF, CF ZF, CF ZF, CF ZF, CF ZF, CF ZF ZF ZF ZF ZF, CF ZF, CF ZF, CF ZF, CF ZF, CF ZF, CF ZF, CF ZF, CF ZF, CF ZF, CF
1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1
ACC, WRn(WRn) + I ACC(R) - (ACC) ACC(WRn) - I ACC, R(R) - (ACC) ACC, WR(WR) - I ACC(R) - (ACC) - (CF) ACC(WRn) - I - (CF) ACC, R(R) - (ACC) - (CF) ACC, WRn(WRn) - I - (CF) ACC, R(R) + 1 ACC, R(R) - 1
- 40 -
W742C814
Instruction set, continued
Machine code Logic 0010 1010 0010 1110 0010 1011 0010 1111 0011 1010 0011 1110 0011 1011 0011 1111 0011 1000 0011 1100 0011 1001 0011 1101 Branch 0111 0aaa 1000 0aaa 1001 0aaa 1010 0aaa 1011 0aaa 1110 0aaa 1100 0aaa 1111 0aaa 1101 0aaa 0100 1000 0100 1000 1010 1000 1010 1000 1010 1001 1010 1001
aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa
Mnemonic
Function
Flag affected
W/C
0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn 0xxx xxxx i i i i nnnn
ANL ANL ANLR ANLR ORL ORL ORLR ORLR XRL XRL XRLR XRLR
R, ACC WRn, #I R, ACC WRn, #I R, ACC WRn, #I R, ACC WRn, #I R, ACC WRn, #I R, ACC WRn, #I
ACC(R) & (ACC) ACC(WRn) & I ACC, R(R) & (ACC) ACC, WRn(WRn) & I ACC(R) (ACC) ACC(WRn) I ACC, R(R) (ACC) ACC, WRn(WRn) I ACC(R) EX (ACC) ACC(WRn) EX I ACC, R(R) EX (ACC) ACC, WRn(WRn) EX I
ZF ZF ZF ZF ZF ZF ZF ZF ZF ZF ZF ZF
1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1
JMP JB0 JB1 JB2 JB3 JZ JNZ JC JNC DSKZ DSKNZ SKB0 SKB1 SKB2 SKB3
L L L L L L L L L R R R R R R
PC12~PC0(ROMPR)x800H+L10~L0 PC10~PC0L10~L0; if ACC.0 = "1" PC10~PC0L10~L0; if ACC.1 = "1" PC10~PC0L10~L0; if ACC.2 = "1" PC10~PC0L10~L0; if ACC.3 = "1" PC10~PC0L10~L0; if ACC = 0 PC10~PC0L10~L0; if ACC ! = 0 PC10~PC0L10~L0; if CF = "1" PC10~PC0L10~L0; if CF != "1" ACC, R(R) - 1; PC (PC) + 2 if ACC = 0 ACC, R(R) - 1; PC (PC) + 2 if ACC ! = 0 PC (PC) + 2 if R.0 = "1" PC (PC) + 2 if R.1 = "1" PC (PC) + 2 if R.2 = "1" PC (PC) + 2 if R.3 = "1" ZF, CF ZF, CF
1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1
0xxx xxxx 1xxx xxxx 0xxx xxxx 1xxx xxxx 0xxx xxxx 1xxx xxxx
- 41 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
Instruction set, continued
Machine code Data move 0001 0000 1110 1nnn 1001 1001 1111 1nnn 0110 1nnn 0111 1nnn 0101 1001 0100 1110 0000 iiii nxxx xxxx iiii nnnn nxxx xxxx nxxx xxxx nxxx xxxx 1xxx xxxx 1xxx xxxx Mnemonic Function Flag affected W/C
MOV MOV MOV MOV MOVA MOVA MOV MOV MOV MOV MOV MOV MOV MOV MOV MOVC
ACC, #I WRn, R WRn, #I R, WRn WRn, R R, WRn R, ACC ACC, R R, #I WRn, @WRq @WRq, WRn TAB0, R TAB1, R TAB2, R TAB3, R R
ACCI WRn(R) WRnI R(WRn) ACC, WRn(R) ACC, R(WRn) R(ACC) ACC(R) RI WRn[(DBKR)x80H+(PAGE)x10H +(WRq)] [(DBKR)x80H+(PAGE)x10H +(WRq)]WRn TAB0(R) TAB1(R) TAB2(R) TAB3(R) R[(TAB3)x1000H+(TAB2)x100H+ (TAB1)x10H + (TAB0)]
ZF
1/1 1/1 1/1 1/1
ZF ZF
1/1 1/1 1/1
ZF
1/1 1/1 1/2 1/2 1/1 1/1 1/1 1/1 1/2
1011 1i i i i xxx xxxx 1100 1nnn 1101 1nnn 1000 1100 1000 1100 1000 1110 1000 1110 1000 1101 n000 qqqq n000 qqqq 0xxx xxxx 1xxx xxxx 0xxx xxxx 1xxx xxxx 0xxx xxxx
Input & Output 0101 1011 0xxx xxxx
MOVA MOVA MOVA MOVA MOV MOV MOV MOV MOV
R, RA R, RB R, RC R, RD RA, R RB, R RC, R RD, R RE, R
ACC, R[RA] ACC, R[RB] ACC, R[RC] ACC, R[RD] [RA](R) [RB](R) [RC](R) [RD](R) [RE](R)
ZF ZF ZF ZF
1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1
0101 1011 1xxx xxxx 0100 1011 0xxx xxxx 0100 1011 1xxx xxxx 0101 1010 0101 1010 0100 1010 1010 1100 0101 1110 0xxx xxxx 1xxx xxxx 0xxx xxxx 1xxx xxxx 0xxx xxxx
- 42 -
W742C814
Instruction set, continued
Machine code Flag & Register 0101 1111 0101 1110 0101 0110 1001 1101 1001 1100 0011 0101 1001 1101 1001 1111 1001 1100 0011 0101 0011 0100 1000 1000 1000 1001 0101 1001 0101 1000 0100 1001 0100 1001 0101 0011 0101 0111 0101 0111 0011 0111 0100 0000 1xxx xxxx 1xxx xxxx 1000 0i i i 1xxx xxxx 1xxx xxxx 1000 i i i i 0000 0000 0000 nnnn nnnn nnnn Mnemonic Function Flag affected W/C
MOVA MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOVA MOV MOVA MOVA MOV MOV MOV MOV CLR MOVA MOVA MOV MOV MOV MOV
R, PAGE PAGE, R PAGE, #I R, WRP WRP, R WRP, #I WRn, DBKR WRn, TM1 DBKR, WRn DBKR, #I ROMPR, #I ROMPR, R R, ROMPR R, CF CF, R R, HCFL R, HCFH PM0, #I PM1, #I PM2, #I PM5, #I EVF, #I R, EVFL R, EVFH HEF, #I IEF, #I PEF, #I SEF, #I
ACC, RPAGE (Page Register) PAGE(R) PAGEI RWRP WRP(R) WRPI WRnDBKR WRnTM1.4 - TM1.7, ACCTM1.0 - TM1.3 DBKRWRn DBKRI ROMPRI ROMPR(R) R(ROMPR) ACC.0, R.0CF CF(R.0) ACC, RHCF.0~HCF.3 ACC, RHCF.4~HCF.7 Port Mode 0 I Port Mode 1 I Port Mode 2 I Port Mode 5 I Clear Event Flag if In = 1 R EVF.0 - EVF.3 R EVF.4 - EVF.7 Set/Reset HOLD mode release Enable Flag Set/Reset Interrupt Enable Flag Set/Reset Port Enable Flag Set/Reset STOP mode wake-up Enable Flag for RC port
ZF
1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1
0000 ii i i 0000 0ii i 0xxx xxxx 0xxx xxxx 0xxx xxxx 0xxx xxxx 0xxx xxxx 1xxx xxxx 0000 i i i i 0000 i i i i 1000 i i i i 1000 i i i i i 0 0 i 0i i i
ZF CF ZF ZF
1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1
0101 1101 0xxx xxxx 0101 1101 1xxx xxxx 0100 0001 0101 0001 0100 0011 0101 0010 i 0 0 i 0i i i i 0 0 i 0i i i 0000 i i i i 0000 i i i i
- 43 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
Instruction set, continued
Machine code Flag & Register 0101 0100 0100 1111 0100 0010 0101 0000 0101 0000 0001 0111 0101 0101 0101 0110 0101 1111 0001 0111 DTMF 1001 1110 1xxx xxxx 0011 0100 1000 0iii Shift & Rotate 0100 1101 0xxx xxxx 0000 i 0 i i 0xxx xxxx 0000 0000 0100 0000 0000 0000 0000 0000 1000 0000 0000 i i i i 0xxx xxxx 1000 0000 Mnemonic Function Flag affected W/C
MOV MOVA CLR SET CLR CLR CLR MOV MOVA CLR
SCR, #I R, PSR0 PSR0 CF CF DIVR0 DIVR1 WDTR, #I R, WDTR WDT
SCRI ACC, RPort Status Register 0 Clear Port Status Register 0 Set Carry Flag Clear Carry Flag Clear the last 4-bit of the Divider 0 Clear the last 4-bit of the Divider 1 WDTRI ACC, RWatchdog Timer Register Clear Watchdog Timer CF CF ZF
1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1
MOV MOV
DTMF, R DTCR, I
DTMF(R) DTCRI
1/1 1/1
SHRC
R
ACC.n, R.n(R.n+1); ACC.3, R.30; CFR.0
ZF, CF
1/1
0100 1101
1xxx xxxx
RRC
R
ACC.n, R.n(R.n+1); ACC.3, R.3CF; CFR.0
ZF, CF
1/1
0100 1100
0xxx xxxx
SHLC
R
ACC.n, R.n(R.n-1); ACC.0, R.00; CFR.3
ZF, CF
1/1
0100 1100
1xxx xxxx
RLC
R
ACC.n, R.n(R.n-1); ACC.0, R.0CF; CFR.3
ZF, CF
1/1
- 44 -
W742C814
Instruction set, continued
Machine code LCD 1001 1000 1001 1000 1001 1010 1001 1011 0xxx xxxx 1xxx xxxx 0xxx xxxx 0xxx xxxx Mnemonic Function Flag affected W/C
MOV MOV MOV MOV LCDON LCDOFF
LPL, R LPH, R @LP, R R, @LP
LPL(R) LPH(R) [(LPH)x10H+(LPL)](R) R[(LPH) x10H+(LPL)] LCD ON LCD OFF
1/1 1/1 1/1 1/1 1/1 1/1
0000 0010 0000 0000 0000 0010 1000 0000 MFP 0011 0110 0000 000i 1000 1010 0xxx xxxx 1000 1011 0xxx xxxx 0001 0010 Timer 1010 1010 0xxx xxxx 1010 1010 1xxx xxxx 1010 1011 0xxx xxxx 1010 1011 1xxx xxxx 0001 0011 1000 i00i 0001 0011 0000 iiii Other 0000 0000 1000 0000 0000 0000 1100 0000 0000 0000 0000 0000 0101 0000 1100 0000 0101 0000 1000 0000 Subroutine iiii iiii
MOV MOV MOV MOV
BUZCR, #I BUZCR, R R, BUZCR MFP, #I
BUZCR I BUZCR(R) R(BUZCR) [MFP] I
1/1 1/1 1/1 1/1
MOV MOV MOV MOV MOV MOV
TM0L, R TM0H, R TM1L, R TM1H, R MR0, #I MR1, #I
TM0L(R) TM0H(R) TM1L(R) TM1H(R) MR0(R) MR1(R)
1/1 1/1 1/1 1/1 1/1 1/1
HOLD STOP NOP EN DIS INT INT
Enter Hold mode Enter Stop mode No operation Enable interrupt function Disable interrupt function
1/1 1/1 1/1 1/1 1/1
Push Stack:
0110 0aaa aaaa aaaa
CALL
L
STACK<-PC+1, TAB0, TAB1, TAB2, TAB3, DBKR, WRP, ROMPR, PAGE, ACC, CF; PC12~PC0<-(ROMPR) x 800H + L10~L0 (PC) <- STACK; Pop other register by I Table setting (Refer to Table 8)
1/1
0000 0001 iiii iiii
RTN
#I
1/1
- 45 -
Publication Release Date: February 12, 2003 Revision A2
W742C814
Table 8. The bit definition of RTN Pop PC from stack only Pop PC and TAB0, TAB1, TAB2, TAB3 from stack Pop PC and DBKR from stack Pop PC and WRP from stack Pop PC and ROMPR from stack Pop PC and PAGE from stack Pop PC and ACC from stack Pop PC and CF from stack
Bit definition of I I = 0000 0000 bit0 = 1 bit1 = 1 bit2 = 1 bit3 = 1 bit4 = 1 bit5 = 1 bit6 = 1
11. REVISION HISTORY
VERSION A1 DATE May 2001 MODIFICATION 1. Main oscillator: 3.58MHz crystal. And built-in RC oscillator. 2. Sub oscillator: 32768Hz crystal. 1. Main oscillator: PLL (Phase Lock Loop) output enable. Pump by Sub oscillator. 2. Sub oscillator: 32768Hz crystal
A2
Feb. 12, 2003
Headquarters
No. 4, Creation Rd. III, Science-Based Industrial Park, Hsinchu, Taiwan TEL: 886-3-5770066 FAX: 886-3-5665577 http://www.winbond.com.tw/
Winbond Electronics Corporation America
2727 North First Street, San Jose, CA 95134, U.S.A. TEL: 1-408-9436666 FAX: 1-408-5441798
Winbond Electronics (Shanghai) Ltd.
27F, 2299 Yan An W. Rd. Shanghai, 200336 China TEL: 86-21-62365999 FAX: 86-21-62365998
Taipei Office
9F, No.480, Rueiguang Rd., Neihu District, Taipei, 114, Taiwan, R.O.C. TEL: 886-2-8177-7168 FAX: 886-2-8751-3579
Winbond Electronics Corporation Japan
7F Daini-ueno BLDG, 3-7-18 Shinyokohama Kohoku-ku, Yokohama, 222-0033 TEL: 81-45-4781881 FAX: 81-45-4781800
Winbond Electronics (H.K.) Ltd.
Unit 9-15, 22F, Millennium City, No. 378 Kwun Tong Rd., Kowloon, Hong Kong TEL: 852-27513100 FAX: 852-27552064
Please note that all data and specifications are subject to change without notice. All the trade marks of products and companies mentioned in this data sheet belong to their respective owners.
- 46 -


▲Up To Search▲   

 
Price & Availability of W742C814

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X